#include <vector>    // 包含 std::vector 的定义
#include <cstring>   // 包含 memset 的定义
#include <cstdlib>   // 包含 malloc 的定义

using namespace std;
namespace CWARN_MEM_NONPOD {
	namespace bad {
		struct XXX {
			int x, y;
		};

		struct A
		{
			int a;
			vector<XXX> b;
		};

		void foo() {
			struct A aaa;
			memset(&aaa, 0, sizeof(aaa));
			struct A* paaa = (struct A*)malloc(sizeof(struct A));
			memset(paaa, 0, sizeof(struct A));
			struct XXX xxx;
			memset(&xxx, 0, sizeof(struct XXX)); // OK - struct XXX is POD
		}
	}
	
	namespace good {
		struct XXX {
			int x, y;
		};

		struct A
		{
			int a;
			vector<XXX> b;

			A() : a(0) {}
		};

		void foo() {
			struct A aaa;
			void* paaa_memory = malloc(sizeof(struct A));
			struct A* paaa = new (paaa_memory) A;
			struct XXX xxx;
			memset(&xxx, 0, sizeof(struct XXX));
		}
	}
}